//todo  防止点击穿透，不影响鼠标事件formstyle::after
//border 右&下
@mixin borderRB {
  border-right: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
}
//border 左&上
@mixin borderLT {
  border-top: 1px solid var(--divider-color);
  border-left: 1px solid var(--divider-color);
}

@mixin scollBarStyle {
  &::-webkit-scrollbar {
    width: 0.4rem;
  }
  &::-webkit-scrollbar-thumb {
    background-color: var(--font-hint-color);
    border-radius: 0.2rem;
  }
  &::-webkit-scrollbar-track {
    background-color: var(--scroll-track);
  }
}

.preview {
  background-color: var(--bg-color);
  padding: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  &::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: all !important;
    cursor: default;
  }
  .editors {
    width: 100%;
    padding: unset;
    height: unset;
    &-center {
      &-top {
        height: 100px;
      }
      &-formarea {
        height: unset;
        border: unset;
      }
    }
  }
  .formSubmit {
    .el-input {
      .el-input__wrapper {
        .el-input__inner {
          padding-left: unset;
        }
      }
    }
  }
}

.editors {
  width: 100%;
  height: calc(100vh - 280px);
  background-color: var(--bg-color);
  box-sizing: border-box;
  padding: 0 1rem;
  display: flex;
  gap: 1rem;
  &-left {
    width: 300px;
    height: 100%;
    background-color: white;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
    &-title {
      color: var(--font-main-color);
      width: 100%;
      float: left;
      padding-bottom: 0.5rem;
    }
    &-subtitle {
      color: var(--font-main-color);
      font-size: 12px;
      padding: 0.5rem 0;
      width: 100%;
      float: left;
    }
    &-item {
      width: 45%;
      float: left;
      height: 40px;
      line-height: 40px;
      // margin: 0px 5px 5px;
      background-color: white;
      // border-radius: 5px;
      text-align: center;
      border: 1px solid var(--divider-color);
      &:hover {
        cursor: pointer;
        background-color: var(--el-color-primary);
        color: white;
        border: 1px solid white;
      }
    }
    &-item + &-title {
      margin-top: 2rem;
    }
  }
  &-center {
    flex: 1;
    display: flex;
    background-color: white;
    flex-direction: column;
    overflow-y: auto;
    &-top {
      height: 150px;
      margin: 16px 5px 0 0;
      padding: 0 1rem;
      box-sizing: border-box;
    }
    &-formarea {
      height: calc(100vh - 230px);
      overflow-y: auto;
      box-sizing: border-box;
      padding: 16px;
      border: 1px dashed var(--el-color-primary-light-5);
      &-item {
        position: relative;
        // &::after {
        //   position: absolute;
        //   top: 0;
        //   left: 0;
        //   bottom: 0;
        //   right: 0;
        //   width: 100%;
        //   height: 100%;
        //   content: "";
        // }
        &-hint {
          position: absolute;
          border: 1px solid var(--el-color-primary);
          padding: 0 1rem;
          background-color: white;
          color: var(--el-color-primary);
          top: -50px;
          right: 10px;
          &:hover {
            background-color: var(--el-color-primary);
            color: white;
          }
        }
        &-subtitle {
          color: var(--font-hint-color);
          font-size: 12px;
        }
      }
    }
    //设置滚动条
    &-formarea::-webkit-scrollbar-thumb {
      background-color: rgba(233, 233, 233, 0.925);
      border-radius: 5px;
    }
  }
  &-right {
    width: 300px;
    height: 100%;
    background-color: white;
    box-sizing: border-box;
    padding: 16px;
    // background-color: blue;
  }
  &-table {
    width: 100%;
    @include borderLT;
    &-item {
      display: flex;
      &-label {
        width: 8rem;
        padding: 0 1rem;
        background-color: var(--bg-color-s);
        @include borderRB;
      }
      &-value {
        flex: 1;
        @include borderRB;
      }
    }
  }
  &-inspect {
    width: 100%;
    &-inspect {
      display: flex;
      margin-top: 0.5rem;
      &-label {
        flex: 1;
      }
      &-value {
        width: 2rem;
        text-align: center;
        & + & {
          border-left: 1px solid var(--divider-color);
        }
      }
    }
  }
}

.table {
  &-right {
    color: var(--el-color-primary);
    cursor: pointer;
    &:hover {
      //增加下划线
      text-decoration: underline;
    }
  }
  &-delete {
    width: 1rem;
    height: 1rem;
    margin: 0 1rem;
    &:hover {
      color: red;
    }
  }
}

.formSubmit {
  background-color: transparent;
  text-align: center;
  color: white !important;
  .el-input {
    border: unset !important;
    height: 32px;
    max-width: 120px;
    margin-top: 1rem;

    text-align: center;
    .el-input__wrapper {
      background-color: var(--el-color-primary);
      box-shadow: none;
      &:hover {
        background-color: var(--el-color-primary-light-5);
      }
      .el-input__inner {
        color: white;
        text-align: center;
        padding-left: 1rem;
      }
    }
  }
}

// .formstyle {
//   position: relative;
// }

// .formstyle::after {
//   content: "";
//   position: absolute;
//   top: 0;
//   bottom: 0;
//   left: 0;
//   right: 0;
//   // background-color: #cc1515;
//   opacity: 0.3;
// }

.previewEditor {
  width: 100%;
}
